var t = require;
var e = module;
var o = exports;
var n =
        (this && this.__extends) ||
        (function () {
            var t = function (e, o) {
                return (t =
                    Object.setPrototypeOf ||
                    ({__proto__: []} instanceof Array &&
                        function (t, e) {
                            t.__proto__ = e;
                        }) ||
                    function (t, e) {
                        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
                    })(e, o);
            };
            return function (e, o) {
                function n() {
                    this.constructor = e;
                }
                t(e, o), (e.prototype = null === o ? Object.create(o) : ((n.prototype = o.prototype), new n()));
            };
        })(),
    r =
        (this && this.__decorate) ||
        function (t, e, o, n) {
            var r,
                a = arguments.length,
                i = a < 3 ? e : null === n ? (n = Object.getOwnPropertyDescriptor(e, o)) : n;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(t, e, o, n);
            else
                for (var s = t.length - 1; s >= 0; s--)
                    (r = t[s]) && (i = (a < 3 ? r(i) : a > 3 ? r(e, o, i) : r(e, o)) || i);
            return a > 3 && i && Object.defineProperty(e, o, i), i;
        };
Object.defineProperty(o, "__esModule", {value: !0});
var a = t("ConfS"),
    i = t("Platforms"),
    s = t("QiriHongbao"),
    c = cc._decorator,
    l = c.ccclass,
    u =
        (c.property,
        (function (t) {
            function e() {
                return (null !== t && t.apply(this, arguments)) || this;
            }
            return (
                n(e, t),
                (e.prototype.init = function () {
                    (this.time = this.node.getChildByName("time").getComponent(cc.Label)),
                        (this.七日提现 = this.node.getChildByName("七日提现")),
                        (this.明日再来 = this.node.getChildByName("明日再来")),
                        this.node.on(cc.Node.EventType.TOUCH_END, function () {
                            i.default.popups.show(s.QiriHongbao);
                        }),
                        this.refresh();
                }),
                (e.prototype.refresh = function () {
                    var t = i.default.popups.getPopup(s.QiriHongbao).items;
                    if (t) {
                        var e = "";
                        if (i.default.userStorage.七日红包当天领取记录.length < a.DatasManager.七日红包冷却时间.length)
                            for (var o = 0, n = t; o < n.length; o++) {
                                if (n[o].ling.active) {
                                    e = "有可以领的";
                                    break;
                                }
                            }
                        else e = "今天已领完";
                        switch (
                            ((this.time.node.active = !1), (this.七日提现.active = !1), (this.明日再来.active = !1), e)
                        ) {
                            case "有可以领的":
                                (this.七日提现.active = !0),
                                    this.node.runAction(
                                        cc.repeatForever(
                                            cc.sequence(
                                                cc.scaleTo(0.5, 1.2, 1.2).easing(cc.easeSineInOut()),
                                                cc.scaleTo(0.5, 0.8, 0.8).easing(cc.easeSineInOut())
                                            )
                                        )
                                    );
                                break;
                            case "今天已领完":
                                (this.明日再来.active = !0), this.node.stopAllActions();
                                break;
                            default:
                                (this.time.node.active = !0), this.node.stopAllActions();
                        }
                    } else this.node.active = !1;
                }),
                (e = r([l], e))
            );
        })(cc.Component));
o.default = u;
